using System;

namespace ctsu.BaseForms
{
	public class FormBase2 : System.Windows.Forms.Form
	{

		private System.Windows.Forms.Panel pnl1;
		private Scroll scroll;
		private System.Windows.Forms.HScrollBar hScroll;
		private System.Windows.Forms.VScrollBar vScroll;
		public System.Windows.Forms.Panel pnl2;
		public System.Windows.Forms.Button btnExit;
		public System.Windows.Forms.Button btnCancel;
		public System.Windows.Forms.Button btnSave;
		public System.Windows.Forms.GroupBox ButtonGroup;
		public System.Windows.Forms.Button btnPrint;
		private System.Windows.Forms.ToolTip toolTip1;
		public System.Windows.Forms.Button btnGrid;
		private System.ComponentModel.IContainer components;

		public FormBase2()
		{
			InitializeComponent();

			//initialize the scroll bar functionality
			scroll = new Scroll(pnl2.Height, pnl2.Width, pnl1, pnl2, vScroll, hScroll);
			this.hScroll.ValueChanged += new System.EventHandler(scroll.hScroll_ValueChanged);
			this.vScroll.ValueChanged += new System.EventHandler(scroll.vScroll_ValueChanged);
			if (this.DesignMode)
			{
				pnl2.AutoScroll = true;
				hScroll.Visible = false;
				vScroll.Visible = false;
			}

		}

		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormBase2));
			this.pnl1 = new System.Windows.Forms.Panel();
			this.hScroll = new System.Windows.Forms.HScrollBar();
			this.vScroll = new System.Windows.Forms.VScrollBar();
			this.pnl2 = new System.Windows.Forms.Panel();
			this.ButtonGroup = new System.Windows.Forms.GroupBox();
			this.btnGrid = new System.Windows.Forms.Button();
			this.btnPrint = new System.Windows.Forms.Button();
			this.btnExit = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnSave = new System.Windows.Forms.Button();
			this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
			this.pnl1.SuspendLayout();
			this.ButtonGroup.SuspendLayout();
			this.SuspendLayout();
			// 
			// pnl1
			// 
			this.pnl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
				| System.Windows.Forms.AnchorStyles.Left)
				| System.Windows.Forms.AnchorStyles.Right)));
			this.pnl1.Controls.Add(this.hScroll);
			this.pnl1.Controls.Add(this.vScroll);
			this.pnl1.Controls.Add(this.pnl2);
			this.pnl1.Location = new System.Drawing.Point(0, 40);
			this.pnl1.Name = "pnl1";
			this.pnl1.Size = new System.Drawing.Size(568, 416);
			this.pnl1.TabIndex = 4;
			this.pnl1.Resize += new System.EventHandler(this.pnl1_Resize);
			// 
			// hScroll
			// 
			this.hScroll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.hScroll.LargeChange = 201;
			this.hScroll.Location = new System.Drawing.Point(0, 400);
			this.hScroll.Maximum = 200;
			this.hScroll.Name = "hScroll";
			this.hScroll.Size = new System.Drawing.Size(8, 16);
			this.hScroll.TabIndex = 2;
			this.hScroll.Visible = false;
			// 
			// vScroll
			// 
			this.vScroll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.vScroll.LargeChange = 201;
			this.vScroll.Location = new System.Drawing.Point(552, 0);
			this.vScroll.Maximum = 200;
			this.vScroll.Name = "vScroll";
			this.vScroll.Size = new System.Drawing.Size(16, 8);
			this.vScroll.TabIndex = 1;
			this.vScroll.Visible = false;
			// 
			// pnl2
			// 
			this.pnl2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pnl2.Location = new System.Drawing.Point(0, 0);
			this.pnl2.Name = "pnl2";
			this.pnl2.Size = new System.Drawing.Size(552, 400);
			this.pnl2.TabIndex = 0;
			this.pnl2.Resize += new System.EventHandler(this.pnl2_Resize);
			// 
			// ButtonGroup
			// 
			this.ButtonGroup.Controls.Add(this.btnGrid);
			this.ButtonGroup.Controls.Add(this.btnPrint);
			this.ButtonGroup.Controls.Add(this.btnExit);
			this.ButtonGroup.Controls.Add(this.btnCancel);
			this.ButtonGroup.Controls.Add(this.btnSave);
			this.ButtonGroup.Dock = System.Windows.Forms.DockStyle.Top;
			this.ButtonGroup.Location = new System.Drawing.Point(0, 0);
			this.ButtonGroup.Name = "ButtonGroup";
			this.ButtonGroup.Size = new System.Drawing.Size(568, 40);
			this.ButtonGroup.TabIndex = 6;
			this.ButtonGroup.TabStop = false;
			// 
			// btnGrid
			// 
			this.btnGrid.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnGrid.Image = ((System.Drawing.Image)(resources.GetObject("btnGrid.Image")));
			this.btnGrid.Location = new System.Drawing.Point(336, 11);
			this.btnGrid.Name = "btnGrid";
			this.btnGrid.Size = new System.Drawing.Size(32, 23);
			this.btnGrid.TabIndex = 26;
			this.toolTip1.SetToolTip(this.btnGrid, "View Table");
			// 
			// btnPrint
			// 
			this.btnPrint.Enabled = false;
			this.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
			this.btnPrint.Location = new System.Drawing.Point(136, 11);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new System.Drawing.Size(32, 23);
			this.btnPrint.TabIndex = 25;
			this.toolTip1.SetToolTip(this.btnPrint, "Print");
			this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
			// 
			// btnExit
			// 
			this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
			this.btnExit.Location = new System.Drawing.Point(266, 11);
			this.btnExit.Name = "btnExit";
			this.btnExit.Size = new System.Drawing.Size(32, 23);
			this.btnExit.TabIndex = 24;
			this.toolTip1.SetToolTip(this.btnExit, "Exit");
			this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.Enabled = false;
			this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
			this.btnCancel.Location = new System.Drawing.Point(226, 11);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(32, 23);
			this.btnCancel.TabIndex = 21;
			this.toolTip1.SetToolTip(this.btnCancel, "Cancel");
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// btnSave
			// 
			this.btnSave.Enabled = false;
			this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
			this.btnSave.Location = new System.Drawing.Point(186, 11);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(32, 23);
			this.btnSave.TabIndex = 20;
			this.toolTip1.SetToolTip(this.btnSave, "Save");
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// FormBase2
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(568, 462);
			this.Controls.Add(this.ButtonGroup);
			this.Controls.Add(this.pnl1);
			this.Name = "FormBase2";
			this.Text = "FormBase2";
			this.Resize += new System.EventHandler(this.FormBase2_Resize);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.FormBase2_Closing);
			this.Load += new System.EventHandler(this.FormBase2_Load);
			this.Closed += new System.EventHandler(this.FormBase2_Closed);
			this.pnl1.ResumeLayout(false);
			this.ButtonGroup.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		#region Load and Scroll
		private void FormBase2_Load(object sender, System.EventArgs e)
		{
			Console.WriteLine("FormBase_Load");
			scroll.CalculateScrolls();
		}

		private void pnl1_Resize(object sender, System.EventArgs e)
		{
			if (!this.DesignMode)
				scroll.CalculateScrolls();

		}

		private void pnl2_Resize(object sender, System.EventArgs e)
		{
			if (!this.DesignMode)
			{
				scroll.MaximumHorizontal = pnl2.Width;
				scroll.MaximumVertical = pnl2.Height;
			}
			else
				pnl1.AutoScroll = true;

		}
		#endregion Load and Scroll

		private void btnPrint_Click(object sender, System.EventArgs e)
		{
			Console.WriteLine("btnPrint_Click - base");
		}

		private void btnSave_Click(object sender, System.EventArgs e)
		{

		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{

		}

		private void btnExit_Click(object sender, System.EventArgs e)
		{

		}

		private void FormBase2_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{

		}

		private void FormBase2_Closed(object sender, System.EventArgs e)
		{
			Console.WriteLine("FormBase2_Closed - base");
		}

		private void FormBase2_Resize(object sender, System.EventArgs e)
		{
			this.pnl1.Height = this.Height - 75;
			this.pnl1.Width = this.Width - 8;
		}

	}
}
